package com.lbd.smsplatform.bean;

import com.lbd.base.bean.AbstractEntity;
import lombok.*;
import org.hibernate.annotations.DynamicUpdate;

import javax.persistence.Entity;
import javax.validation.constraints.Digits;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;

/**
 * Created by wang on 2016/9/26.
 */
@Getter
@Setter
@ToString
@AllArgsConstructor
@NoArgsConstructor
@DynamicUpdate
@Entity
public class SmsWhiteList extends AbstractEntity {

    //收件人
    @NotNull
    @Pattern(regexp = "^1\\d{10}$", message = "请输入正确的手机号码。")
    private String recipient;
    //消息限制条数
    @NotNull
    @Digits(fraction = 0, integer = 4, message = "请输入正确的消息限制条数。")
    @Min(1)
    private Integer msgLimitNum;

    //备注
    private String remark;

}
